#include<stdio.h>
#include<stdlib.h>
#include<malloc.h>
#include<string.h>
#define MAX_COMMANDS 2000
#ifndef COM_INCLUDED
    #define COM_INCLUDED
    enum COMMANDS{PUSH = -10014, POP, MOV, add, sub, mul, divi, dub, jb, ja, je, quit, sqrti};
    struct command
    {
        int command;
        int valueType;
        double value;
    };
    struct label
    {
        int position;
        char name[20];
    };
    struct variable
    {
        char name[20];
        double value;
        int isFunction;
    };

    struct program
    {
        struct command com[2000];
        struct label labels[50];
        struct variable var[50];

        int length;
        int numofVar;
        int numofLabels;
    };
#endif // COM_INCLUDED
//<0 for type, >= 0 for varNumber
#ifndef VALUE_TYPE_INC
    #define VALUE_TYPE_INC
    enum VALUE_TYPE{NUMBER = -10, VARIABLE, OUTPUT};
#endif




int registerWriter(FILE* f_ass, char reg);
program* assemble(FILE* f);
int numVar  (program* prgr, char value[]);
int numLabel(program* prgr, char value[]);
void printCommands(const program* prgr);
